#define _CRT_SECURE_NO_WARNINGS 1

class Board {
public:
	bool checkWon(vector<vector<int> > board) {
		vector<vector<int>> max_board;
		int sz = board.size();
		max_board.resize(sz + 4);
		int sz1 = board[0].size();
		for (int i = 0; i < sz + 4; i++) {
			max_board[i].resize(sz1 + 4);
		}
		for (int i = 2; i < sz + 2; i++) {
			for (int j = 2; j < sz1 + 2; j++) {
				max_board[i][j] = board[i - 2][j - 2];
			}
		}
		for (int i = 2; i < sz + 2; i++) {
			for (int j = 2; j < sz1 + 2; j++) {
				if (max_board[i][j] == 1 && ((max_board[i][j - 2] == 1 && max_board[i][j - 1] == 1) || (max_board[i][j + 1] == 1 && max_board[i][j + 2] == 1) || (max_board[i + 1][j] == 1 &
				{
					return true;
				}
				if (max_board[i][j] == -1 && ((max_board[i][j - 2] == -1 && max_board[i][j - 1] == -1) || (max_board[i][j + 1] == -1 && max_board[i][j + 2] == -1) || (max_board[i + 1][j] =
					{ return true;
					}
			}
		}
		return false;
	}
};